package com.tourismhengyang.beans;

public class Ticket {
	private int tid;
	private int lid;
	private String ttype;
	private double tprice;
	
	@Override
	public String toString() {
		return "Ticket [tid=" + tid + ", lid=" + lid + ", ttype=" + ttype + ", tprice=" + tprice + "]";
	}

	public int getTid() {
		return tid;
	}

	public void setTid(int tid) {
		this.tid = tid;
	}

	public int getLid() {
		return lid;
	}

	public void setLid(int lid) {
		this.lid = lid;
	}

	public String getTtype() {
		return ttype;
	}

	public void setTtype(String ttype) {
		this.ttype = ttype;
	}

	public double getTprice() {
		return tprice;
	}

	public void setTprice(double tprice) {
		this.tprice = tprice;
	}

	public Ticket(int tid, int lid, String ttype, double tprice) {
		super();
		this.tid = tid;
		this.lid = lid;
		this.ttype = ttype;
		this.tprice = tprice;
	}

	public Ticket() {
		super();
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + lid;
		result = prime * result + tid;
		long temp;
		temp = Double.doubleToLongBits(tprice);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + ((ttype == null) ? 0 : ttype.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Ticket other = (Ticket) obj;
		if (lid != other.lid)
			return false;
		if (tid != other.tid)
			return false;
		if (Double.doubleToLongBits(tprice) != Double.doubleToLongBits(other.tprice))
			return false;
		if (ttype == null) {
			if (other.ttype != null)
				return false;
		} else if (!ttype.equals(other.ttype))
			return false;
		return true;
	}
}
